package data;

import java.util.Vector;

import com.icons.draw.view.MapLocation;

public class ParkingDB {
	
	
	private static ParkingDB parking_db=null;
	private final static Integer myMutex = new Integer(1);
	public Vector<ParkingSpotsList> parkingVector=null;
	public int IndexArray_A[];
	public int IndexArray_B[];
	public int listIndex_A=-1;
	public int listIndex_B=-1;
	public String userID;
	public String instanceDNS="ec2-23-21-21-171.compute-1.amazonaws.com";
	public boolean serverOn=true;
    public MapLocation curLoc=null;
    public MapLocation preLoc=null;
    public int closestParkingIndex;
    public boolean gps=true;
    public boolean user_gps=false;
    public String userStreet=null;
    public MapLocation noGpsLoc;
    public boolean myParking=false;
    public double mySpotLat;
    public double mySpotLong;


	private  ParkingDB(){
		 parkingVector = new Vector< ParkingSpotsList>();
		 IndexArray_A=new int[5];
		 IndexArray_B=new int[5];
		// curLoc=new MapLocation("i am here!",32.068188492013135,34.76519264280796);
		 noGpsLoc=new MapLocation("i am here!",32.068188492013135,34.76519264280796);
			for(int i=0;i<5;i++)
			{
				IndexArray_A[i]=-1;
				IndexArray_B[i]=-1;
			}

	}



	public static ParkingDB getInstance() {
		if (parking_db == null) {
			synchronized(myMutex){
				if (parking_db == null){
					parking_db = new ParkingDB();
				}
			}
		}
		return parking_db;
	}

}
